package com.mark.web.data.enums;

/**
 * @Description: 响应模型的枚举类
 * @Author: Mark
 * @CreateDate: 2018/3/22.
 * @Version: 2.0
 * @Copyright : 豆浆油条个人非正式工作室
 */
public enum ResponseCode {

    /**
     *请求响应的状态码
     * SUCCESS ：成功
     * ERROR ：错误
     * NEED_LOGIN ：需要登录
     * SELLER_NEED_LOGIN ： 卖家登录
     * ILLEGAL_ARGUMENT ：请求参数不合法
     * Exception ：请求发现异常
     */
    SUCCESS(0,"SUCCESS"),
    ERROR(1,"ERROR"),
    NEED_LOGIN(10,"NEED LOGIN"),
    SELLER_NEED_LOGIN(11,"NEED LOGIN"),
    ILLEGAL_ARGUMENT(2,"ILLEGAL ARGUMENT"),
    Exception(-1,"Exception");

    private final int code;
    private final String desc;


    ResponseCode(int code,String desc){
        this.code = code;
        this.desc = desc;
    }

    public int getCode(){
        return code;
    }
    public String getDesc(){
        return desc;
    }

}
